﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Collections;
using DelonixRegiaHotel.DBManager;
using DelonixRegiaHotel.Classes;

namespace DelonixRegiaHotel
{
    public partial class RoomOccupancyDaily : Form
    {
        double roomNo;
        double tempRoomOccupancy;

        public RoomOccupancyDaily()
        {
            roomNo = ReportDBManager.getNoRoomStatus();
            InitializeComponent();
        }

        private void RoomOccupancyDaily_Load(object sender, EventArgs e)
        {
            
        }

        private void BTNcalculate_Click(object sender, EventArgs e)
        {
           RoomOccupancy newRoomOccu = new RoomOccupancy();
           tempRoomOccupancy = calculateRoomOccupancy(roomNo, 35);
           newRoomOccu.RoomOccupan = tempRoomOccupancy;
           ReportDBManager.InsertRoomOccupancy(newRoomOccu);

           // TODO: This line of code loads data into the 'RoomOccupancyDailyDataSet.DataTable1' table. You can move, or remove it, as needed.
           this.DataTable1TableAdapter.Fill(this.RoomOccupancyDailyDataSet.DataTable1);
           this.reportViewer1.RefreshReport();
           
            //label1.Text = Convert.ToString(tempRoomOccupancy);
        }


        public double calculateRoomOccupancy(double NoRoomStatus, double TotalRoomNo)
        {
           double roomOccu = (NoRoomStatus / TotalRoomNo) * 100;
           return roomOccu;
        }
    }
}
